<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<html>
<!--  -->
	<head>

		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

		<title>仪器共享</title>

		<meta name="keywords" content="科研仪器，生命科学仪器，环境检测仪器，实验常用设备，分析仪器">

		<meta name="description" content="中国领先的科研仪器共享平台，让您快速找到各种类型的科学研究仪器。提升闲置仪器利用率，产生更大科研价值。涵盖：生命科学仪器、环境检测仪器、实验常用设备、分析仪器、仪表、物性测试、测量/计量仪器、在线及过程控制仪器。
">
		<link rel="stylesheet" href="new_css/userCenter.css">
		<link rel="stylesheet" href="css/new_style.css">
		<script src="new_js/jquery-1.11.3.js"></script>
		<script src="js/jquery.pagination.min.js"></script>
		<link rel="stylesheet" href="css/reset.css">
		<link rel="stylesheet" href="css/common.css">

		<script>
		$(document).ready(function() {
			$("#addInfo").click(function(){
				$(location).attr('href', "lizisepuyi16");
				});
			$("#addTime").click(function(){
				$(location).attr('href', "add18");
				
				});
			$("#goInfoOrder").click(function(){
				$(location).attr('href', 'book_admin23');
				});
			$("#addtInfo").click(function(){
				$(location).attr('href', 'publishInstrument17');
				});
		    $("#iiInfo").click(function(){
				$(location).attr('href', 'yiqixinxiweihu15');
				});
			$("#serviceOrder").click(function(){
				$(location).attr('href', 'service_public24_1');
				});
			
			});
		</script>
		<script>
			$(function() {
				
				$('#front_header .header_wrap .right').hover(function() {
					$('#front_header .header_wrap .right .main .icon img').attr('src', 'images/icon2.png');
					$('#front_header .header_wrap .right .out').show();
				}, function() {
					$('#front_header .header_wrap .right .main .icon img').attr('src', 'images/icon1.png');
					$('#front_header .header_wrap .right .out').hide();
				});
				
				//-----
				$("#item2").mouseover(function(){
			       $(".item2_ul").css("display","block");
				});


$("#item2").mouseout(function(){
       $(".item2_ul").css("display","none");
});
				$("#item1").mouseover(function(){
				
       			$(".item1_ul").css("display","block");
				});


				$("#item1").mouseout(function(){
       			$(".item1_ul").css("display","none");
				});
				$('#sorts').on('mouseover', 'li', function() {
					$(this).find('span img').attr('src', 'images/icon4.png');
				});
				$('#sorts').on('mouseout', 'li', function() {
					$(this).find('span img').attr('src', 'images/icon5.png');
				});
				
				$('.mainList .content .left li').click(function(){
					$(this).addClass('selected').siblings().removeClass('selected');
				});
				$('option').click(function(){
					$(this).addClass('selected').siblings().removeClass('selected');
				});
			})
		
		</script>
		<!-- <script src="method/xue/service_public24_1.js"></script> -->
	</head>

	<body style="background:#fff;">

		<%@include file="/header2.jsp"%>
		
		<div class="mainList">
			<!--<div class="bNav">您的位置：首页><span>用户中心</span></div>-->
			<div class="content">
				<div class="left">
					<div class="title">仪器管理</div>
					<!--<div class="list_header">全部订单<img src="images/usercenter_icon.png" /></div>-->
					
						<div class="sun_title">日期</div>
						<div class="sun_option">
							<select id="sun_time">
								<option value="1"  class="selected">全部</option>
								<option value="2" >本周</option>
								<option value="3" >本月</option>
							</select>
						</div>
						<div class="sun_a">
							<a onclick="MyObjectLoad()">查询</a>
						</div>
						<!--<li class="selected">待确认</li>
						<li>待支付</li>
						<li>待实验</li>
						<li>已完成</li>
						<li>未评价</li>
						<li>个人资料</li>-->
					
				</div>
				<div class="right"> 
					<div class="title"><span>服务预约订单</span></div>
					<div class="tab_header">
						<div class="item1">服务名称</div>
						<div class="item2"></div>
						<div class="item3">服务收费</div>
						<div class="item4">服务负责人</div>
						<div class="item5">交易状态</div>
						<div class="item6">交易操作</div>
					</div>
					<div class="infoList">
					<%--orderList--%>
						<ul id="orderList">
							<li>
								<div class="row1">
									<div>
										<span>2018-03-13 18:36:04 </span>
										<span>订单编号: 3232430800330166</span>
									</div>
									<div><img src="images/usercenter_icon2.png" /></div>
								</div>
								<div class="row2">
									<div class="tab1"><img src="images/usercenter_pic.png" /></div>
									<div class="tab2">高内涵筛选系统</div>
									<div class="tab3">operetta</div>
									<div class="tab4">张三</div>
									<div class="tab5">
										<p>待确认</p>
										<p>
											<a href="bookingOrderDetail24">查看详情</a>
										</p>
									</div>
									<div class="tab6">
										<div class="btn">
											<a href="bookingOrderDetail24">待支付</a>
										</div>
										<div class="time">还剩11:23:02</div>
									</div>
								</div>
							</li>
							<li>
								<div class="row1">
									<div>
										<span>2018-03-13 18:36:04 </span>
										<span>订单编号: 3232430800330166</span>
									</div>
									<div><img src="images/usercenter_icon2.png" /></div>
								</div>
								<div class="row2">
									<div class="tab1"><img src="images/usercenter_pic.png" /></div>
									<div class="tab2">高内涵筛选系统</div>
									<div class="tab3">operetta</div>
									<div class="tab4">张三</div>
									<div class="tab5">
										<p>待确认</p>
										<p>
											<a href="bookingOrderDetail24">查看详情</a>
										</p>
									</div>
									<div class="tab6">
										<div class="btn">
											<a href="bookingOrderDetail24">待支付</a>
										</div>
										<div class="time">还剩11:23:02</div>
									</div>
								</div>
							</li>
						</ul>
						<div class="myPage clearfix">
						<!--currentpage="1" numbercount="100"-->
						<ul class="page" maxshowpageitem="5" pagelistcount="5"  id="page"></ul>
						</div>
					</div>
				</div>
			</div>

	<!-- 		<div class="pageButton">
			<div id="pagination3" class="page fl"></div>
			<div class="info fl">
				<p>当前页数：<span id="current3">1</span></p>
			</div>
			<input type="text" id="allinfonumber" style="display:none"/>
		</div>
		</div> -->

		<script type="text/javascript" src="js/jquery-1.11.3.js"></script>
		<script src="js/common.js"></script>

	</div>
		<%@include file="/footer.jsp"%>
	<style>
		.mainList .content .right .infoList li .row2 .tab1 img {
			width: 100px;
			height: 100px;
			vertical-align: middle;
		}

	.myPage {
	margin: 0 auto;
	width: 990px;
	height: 80px;
	font-size: 12px;
	margin-top: 40px;
	margin-left: 431px;
	}

	ul#page li {
    height: 20px;
}
	
	</style>
	<script>
		$(document).ready(function(){
			MyObjectLoad();
		})
		
		function dele(id){
			$.ajax({
				//url:"http://localhost/user/sum/delOrder",
				url:Server + "/user/sum/delOrder",
				data:{
					orderId:id,
				},
				type:"POST",
				success : function(data){
					if(data == 0){
						alert("删除失败")
					}else if(data == 1){
						alert("删除成功")
						window.location.reload()
						//list(0)
					}
				},
				error : function(data){
					alert("异常")
				}
			})
		}
		
		function del(id){
			var msg = '您真的确定要删除吗？\n\n请确认！';
			if(confirm(msg)==true){
				dele(id);
				return true;
			}else{
				return false;
			}
		}
		
		MyObject = {
			//url:"http://localhost/user/sum/ssiList",
			url:Server + "/user/sum/ssiList",
			haveuid : $("#useridoflogin").val(),
			ishavesend : 0,
			boolean : false,
			type : "POST",
			dataType : "JSON",
			number : 1,
			AllCount : 0,
			nowp : 0,
			Callback : function(nowPage){
				MyObject.nowp = nowPage;
				list(MyObject.nowp -1);
			}
		}
		
		function MyObjectLoad(){
			var dateFilter = $('#sun_time option:selected').val();
			//var uId = $('#useridoflogin').val();
			$("#page").initPage((function(){
				$.ajax({
					url : MyObject.url,
					type : MyObject.type,
					dataType : MyObject.dataType,
					async : MyObject.boolean,
					data : {
						uId : MyObject.haveuid,
						dateFilter : dateFilter,
						limit : MyObject.number,
						offset : MyObject.number,
					},
					success : function(data){
						MyObject.AllCount = data.total;
					}
				});
				return MyObject.AllCount;
			})(),MyObject.number,MyObject.Callback);
		}
		MyObjectLoad();
		
		function list(offset){
			var dateFilter = $('#sun_time option:selected').val();
			var uId = $('#useridoflogin').val();
			//var uId = '4d272484d5844be693c05443c4edd71e';
			$.ajax({
				//url:"http://localhost/user/sum/ssiList",
				url:Server + "/user/sum/ssiList",
				data:{
					uId : uId,
					dateFilter : dateFilter,
					limit : 5,
					offset : offset,
				},
				type:"POST",
				dataType:"json",
				success : function(data){
					var param = data.rows;
					var html = "";
					var pattren = '<li>\
								<div class="row1">\
									<div>\
										<span>#0</span>\
										<span>订单编号: #1</span>\
									</div>\
									<div><img class="delIcon" src="images/usercenter_icon2.png" onclick="del(#10)" /></div>\
								</div>\
								<div class="row2">\
									<div class="tab1"><img src="#2" /></div>\
									<div class="tab2"><a href="serviceDetail14_2?serviceId=#12">#3</a></div>\
									<div class="tab3">#4#11</div>\
									<div class="tab4">#5</div>\
									<div class="tab5">\
										<p>#6</p>\
										<p>\
											<a href="service_public24_2?orderId=#8&type=1">查看详情</a>\
										</p>\
									</div>\
									<div class="tab6">\
										<div class="btn" name="insBtn">\
											<a href="service_public24_2?orderId=#9&type=2">#7</a>\
										</div>\
									</div>\
								</div>\
							</li>';
					for(var i = 0;i < param.length;i++){
						var item = '';
						var state = '';
						var state1 = '';
						var aunit = (param[i].aUnit == null)?'':param[i].aUnit;
						if(param[i].status != null){
							if(param[i].status == 0){
								state = '订单待确定';
								state1 = '确认';
							}
							if(param[i].status == 1){
								state = '待支付';
							}
							if(param[i].status == 2){
								state = '已支付';
							}
							if(param[i].status == 6){
								state = '已关闭';
							}
						}
						item += pattren
							.replace("#0",param[i].createTime)
							.replace("#1",param[i].number)
							.replace("#2",param[i].imagePath)
							.replace("#3",param[i].serviceName)
							.replace("#4",param[i].serviceFee)
							.replace("#5",param[i].contacts)
							.replace("#6",state)
							.replace("#7",state1)
							.replace("#8",param[i].id)
							.replace("#9",param[i].id)
							.replace("#10",param[i].id)
							.replace("#11",aunit)
							.replace("#12",param[i].inId),
						html += item;
					}
					$('#orderList').html(html);
					$(".delIcon").each(function(){
						if($(this).parent().parent().next().children().eq(4).children().eq(0).text()!='已关闭'){
							$(this).hide();
						}
					});
					$("div[name='insBtn']").each(function(){
					var btnContent=$(this).children().eq(0).text();
					if(btnContent==""){
						$(this).parent().empty();
					}else if(btnContent=="待支付"||btnContent=="已支付"){
						$(this).next().hide();
					}
				});
				}
			})
		}
	</script>
<style>
	.mainList .content .right {
		width: 950px;
		float: right;
		height: 100%;
		position: relative;
		min-height: 1000px;
		padding: 0 20px;
		border: 1px solid #d3d3d3;
	}
	.myPage {
		margin: 0 auto;
		width: 600px;
		height: 80px;
		font-size: 12px;
		position: absolute;
		bottom: 0px;
		left: 400px;
	}
	</style>
	<script src="js/new_js/common.js"></script>
	</body>

</html>